<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <title>${formField.titleTag}</title>
    <meta name="description" content="${formField.descripTag}">
    <meta name="keywords" content="${formField.keywordTag}">
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="static/templates/templ${formField.idTemplate}/style.css" type="text/css" media="all" />
    <script src="static/js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="static/js/html5.js" type="text/javascript"></script>
    <script src="static/js/functions.js" type="text/javascript"></script>
    <script>
        $(document).ready(function(){
            $("#countdown").countdown({
                        date: "${formField.myCount1} ${formField.myCount2}:${formField.myCount3}:${formField.myCount4}",   //"09 may 2013 07:00:00"
                        format: "on"
                    },

                    function() {
                        // callback function
                    });
            $('a.back').click(function(){
                parent.history.back();
                return false;
            });

            //скрипт для захвата мыла подписчиков
            var email = '';
            var pattern = /^[a-z0-9_-]+@[a-z0-9-]+\.([a-z]{1,6}\.)?[a-z]{2,6}$/i; //
            //скрытый тег с айдишником странички, откуда возьму его значение, либо просто сразу в get подставлять
            var idPage = $('#siteID').val();
            $(':submit').click(function(e) {
                //выбираю атрибуты name, в значениях которых есть слово email, т.к. бывают случаи с field_email
                email = $("input[name~='email']").val();
                if(email.search(pattern) == 0)
                {
                    $.get("addsubscriber.html?email=" + email + "&site_id=" + idPage);
                }
            });
        });
    </script>
    <style>
        #specpanel{position:absolute;z-index:2;bottom:10px;right:65px;width:350px;text-align:center;}
        .insidepanel{width:70px;margin-right: 7px;background-color:#ffffff;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #000000; behavior:url(../../static/css/ie/PIE.htc);}
        .tdpanel :hover{background-color:#c0c0c0;}
    </style>
</head>

<body>

<section id="wrapper">

    <div id="cont">

        <header>
            <p>${formField.addMess}</p>
            <div class="clear"></div>
        </header>

        <section id="box">
            <div class="arrow-up"></div>
            <div id="box-top">
                <h1>${formField.mainHeader}</h1>
                <p>${formField.dopText}</p>

                <div id="form">
                    <form method="post" action="${formField.action} ">
                        ${formField.inputsCode}
                        <input type="hidden" id="siteID" value="${formField.idTemplate}">
                    </form>
                </div>

            </div>
            <div id="box-bottom">

                <div id="countdown-container">
                    <p class="launch-text">Осталось...</p>
                    <div id="timer">
                        <ul id="countdown">
                            <li>
                                <span class="days">00</span>
                                <p class="timeRefDays">дней</p>
                            </li>
                            <li>
                                <span class="hours">00</span>
                                <p class="timeRefHours">часов</p>
                            </li>
                            <li>
                                <span class="minutes">00</span>
                                <p class="timeRefMinutes">минут</p>
                            </li>
                            <li>
                                <span class="seconds">00</span>
                                <p class="timeRefSeconds">секунд</p>
                            </li>
                        </ul>
                    </div>
                    <div class="clear"></div>
                </div>

            </div>
        </section>

        <div id="footer">
            <p class="legal"><a href="http://${formField.mySite}" target="_blank">${formField.companyName}</a></p>
        </div>

    </div>
</section>
<!-- код статистики -->
${formField.statCode}
<!-- код статистики -->
<c:if test="${empty notshow}">
    <div id="specpanel">
        <table style="width:340px; border:0px; text-align:center;">
            <tr>
                <td class="tdpanel">
                    <p>

                    <div class="insidepanel"><a href="userhome_lead.html"><img src="static/img/menu_up_right/user.png"
                                                                               title="кабинет" width="64" alt=""></a>
                    </div>
                    </p>
                </td>
                <td class="tdpanel">
                    <p>

                    <div class="insidepanel"><a href="templates.html"><img src="static/img/specpanel/templates.png"
                                                                           title="список шаблонов" width="64"
                                                                           alt=""></a></div>
                    </p>
                </td>
                <td class="tdpanel">
                    <p>

                    <div class="insidepanel"><a class="back" href="#"><img src="static/img/specpanel/edit.png"
                                                                           title="редактировать" width="64" alt=""></a>
                    </div>
                    </p>
                </td>
                <td class="tdpanel">
                    <p>

                    <div class="insidepanel"><a href="save_laun_site.html"><img src="static/img/specpanel/save.png"
                                                                                title="сохранить" width="64" alt=""></a>
                    </div>
                    </p>
                </td>
                <td class="tdpanel">
                    <p>

                    <div class="insidepanel"><a href="download?templId=2"><img src="static/img/specpanel/download.png"
                                                                               title="скачать" width="64" alt=""></a>
                    </div>
                    </p>
                </td>
            </tr>
        </table>
    </div>
</c:if>

</body>
</html>
